package com.jfm.jfmm.collector.enums.snmp;

import lombok.Getter;

/**
 * @author DYang
 * @since 2024-10-09 22:28
 */
@Getter
public enum SNMPMethod {

    GET("get"),

    WALK("walk"),

    GET_NEXT("getNext");

    private final String method;

    SNMPMethod(String method) {
        this.method = method;
    }

    /**
     * 根据方法名获取枚举值
     * @param method 方法名
     * @return 枚举值
     */
    public static SNMPMethod getMethod(String method) {
        for (SNMPMethod value : values()) {
            if (value.method.equals(method)) {
                return value;
            }
        }
        return null;
    }
}
